package com.weblog.weblogapi.controller;


import com.weblog.weblogapi.dao.pojo.OrderMember;
import com.weblog.weblogapi.service.OrderMemberService;
import com.weblog.weblogapi.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@RequestMapping("/order")
public class OrderMemberController {
    @Autowired
    private OrderMemberService orderMemberService;
        //下订单
    @GetMapping("/buy")
    public void buyMember(OrderMember  orderMember, HttpServletResponse httpResponse) throws IOException {
        orderMemberService.buyMember(orderMember, httpResponse);
    }
    @PostMapping("/notify")
    public Result payNotify(HttpServletRequest request) throws Exception{return orderMemberService.payNotify(request);}

}
